package com.system.mapper;

import com.system.pojo.Contract;
import com.system.pojo.ContractExample;
import com.system.vo.TimeScope;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ContractMapper {
    long countByExample(ContractExample example);

    int deleteByExample(ContractExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Contract record);

    int insertSelective(Contract record);

    List<Contract> selectByExample(ContractExample example);

    Contract selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Contract record, @Param("example") ContractExample example);

    int updateByExample(@Param("record") Contract record, @Param("example") ContractExample example);

    int updateByPrimaryKeySelective(Contract record);

    int updateByPrimaryKey(Contract record);

    /**
     *
     * @param contractId
     * @return 合同详情
     * 合同基本信息
     * 合同商品表信息
     * 发货单信息
     */
    Contract selectDetail(Integer contractId);

    List<Contract> selectAllDone();

    List<Contract> selectAllUndone();

    List<Contract> salerContracts(Integer uid);

    List<Contract> selectAll();

    List<Contract> selectBySalerId(Integer uid);

    int updateStatusById(int contractId);

    Contract selectWithClientAndSaler(Integer contractId);

    List<Contract> selectByClientId (Integer clientId);

    List<Contract> selectAllWithTimeScope(TimeScope t);

    List<Contract> selectBySalerIdWithTimeScope(TimeScope t);

    int updateFinishById(int contractId);
}